package com.huige.path;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author 朱志辉
 * @Create 2024/7/18 下午5:43
 * @Version 1.0
 * Description:
 */
@Controller
@RequestMapping("path")
@ResponseBody
public class PathController {

    // path/账号/密码
    //动态路径的设计 /{账号}/{密码} 在形参列表获取传入的参数
    //接受路径参数 String account, String password -》接受param格式参数
    //必须使用@PathVariable
    @RequestMapping("{account}/{password}")
    public String login(@PathVariable String account,@PathVariable String password) {
        System.out.println("account = " + account + ", password = " + password);
        return "success";
    }



}
